home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / math / differ.zip / DIFFER.DOC < prev    next >
Text File  |  1996-04-06  |  5KB  |  112 lines

  1. /*
  2.    DIFFER DOCUMENT EXPLAINING BASIC USAGE
  3.    This program was written to help with differentiation. It accepts
  4.    algebraic expressions with support for a number of functions and will
  5.    differentiate the expression with respect to x.
  6.  
  7.    This program was written by Paul Young, using Turbo C++.
  8.    I accept no responsibility for use or misuse of this program in any way.
  9.    This program is Public Domain.
  10.    It may be copied freely provided this notice is included.
  11.    This program may be used as a base or included in other programs
  12.    however these programs must also be Public Domain and no monetary gain
  13.    should be made from these. Help support Public Domain programming.
  14. */
  15.  
  16. NB This program should be easily extendible using a C Compiler with the
  17. routines already present, although it is already a fairly complete program.
  18. Some people may feel the need to add further simplifications or functions
  19. but generally this shouldn't be necessary.
  20.  
  21. The power of the program is its ability to handle very complicated 
  22. expressions like say sin(cos(x^tan(x)-ln(arccosh(1/x^4*sinh(x))))).
  23.  
  24. COMMANDS
  25. --------
  26. There are a number of commands available and these will be described
  27. below. Where an expression is expected it is indicated as <expr>. These
  28. and supported functions will be discussed later.
  29.  
  30. COMMAND SUMMARY
  31. ---------------
  32. Command                        Action
  33. --------------------------------------
  34. quit                           Quits the program.
  35.  
  36. go <expr>                      This is one of the most useful
  37.                                commands at first. It enters the expression,
  38.                                differentiates and simplifies before
  39.                                displaying the result.
  40.  
  41. again                          This instructs the program to continue with
  42.                                the same expression. It differentiates it 
  43.                                again, simplifies and displays the result.
  44.  
  45. batch <expr>                   This is similar to 'go' but it prints out
  46.                                the first expression before doing anything.
  47.                                It also prints a header 'Input expression'
  48.                                and a second one 'Output expression' before
  49.                                the expressions. Its use is that commands
  50.                                can be entered into a text file, ending with
  51.                                quit. The text file can be directed as input
  52.                                to the program and output directed to another
  53.                                file (see go.bat). In this way the whole thing
  54.                                can be automated over a list of expressions.
  55.  
  56. The remaining commands are more easily used for debugging, when making any
  57. alterations to the program.
  58.  
  59. input <expr>
  60. expr <expr>                    These do the same thing. An expression is
  61.                                typed and held in memory.
  62. print                          Prints the current expression to the screen.
  63. diff                           Differentiates the current expression, but
  64.                                note that this is not simplified (and the
  65.                                result will be ugly).
  66. simplify                       Simplifies the current expression.
  67.  
  68. EXPRESSIONS
  69. -----------
  70. Expressions are simple to enter. Here are some valid expressions :-
  71. x^2+3*x^3-7*x^4
  72. a*x^3+b*x^2+c*x+d
  73. (x+2)^(x-7)
  74. (-x)^7
  75. sin(x)
  76. sin(cos(x))
  77. sin(cos(x)+4-x)*tan(x)
  78. x*-2
  79.  
  80. And here are some invalid expressions :-
  81. 3x+2                             : should be 3*x+2
  82. (3*x-2)(2*x+1)                   : should be (3*x-2)*(2*x+1)
  83.  
  84. Precedence is mainly standard but expressions like
  85. x^x^x
  86. are ambiguous and you should use brackets to force precedence, for example
  87. (x^x)^x or x^(x^x)
  88. Whenever you are not sure, use brackets.
  89.  
  90. FUNCTIONS
  91. ---------
  92. The following functions are supported :-
  93. exp,ln                           - natural logarithms.
  94. ie exp(x) and ln(x)
  95.  
  96. sin,cos,tan,cosec,cot,sec        - standard trig functions
  97. sinh,cosh,tanh,cosech,coth,sech  - standard hyperbolic trig functions
  98. arcsin,arccos,arctan             - inverse trig functions
  99. arcsinh,arccosh,arctanh          - inverse hyperbolic trig functions
  100.  
  101. CONSTANTS
  102. ---------
  103. All letters of the alphabet (except x) can be used as constants.
  104. Floating point entries are allowed for constants eg 0.5, 3.1415, etc
  105.  
  106. EVALUATION
  107. ----------
  108. If there is enough demand for the addition of a routine to evaluate 
  109. expressions for a given value of x then I'll add it. Nuff said.
  110. Write to P Young 101716.3323@compuserve.com
  111.  
  112.